package com.chuangjiangx.member.coupon.ddd.domain.model;

import lombok.Getter;

/**
 * Created by zhoufushou on 2017/12/16.
 * 购买的卡券是否支持退款
 */
@Getter
public enum SupportRefunds {
    YES("支持退款", (byte)0),
    NO("不支持退款", (byte)1);

    public final String name;
    public final Byte code;

    SupportRefunds(String name, Byte code) {
        this.name = name;
        this.code = code;
    }

    public static SupportRefunds get(Byte code){
        for(SupportRefunds back : values()){
            if(back.code.equals(code)){
                return back;
            }
        }
        return null;
    }
}
